package com.cg.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.time.LocalDateTime;;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 
 * </p>
 *
 * @author lhy
 * @since 2024-12-26
 */
@Getter
@Setter
@Schema(description = "Fence对象")
public class Fence implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "围栏唯一标识符，自增主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Schema(description = "牧场ID，关联到牧场表中的id字段，表示该围栏所属的牧场，非空")
    private Integer farmId;

    @Schema(description = "牧场名称，可选冗余字段，用于提高读取性能，非必需")
    private String farmName;

    @Schema(description = "圈舍ID，关联到圈舍表中的id字段，表示该围栏所属的圈舍，非空")
    private Integer barnId;

    @Schema(description = "圈舍名称，可选冗余字段，用于提高读取性能，非必需")
    private String barnName;

    @Schema(description = "围栏名称，字符串类型，表示特定围栏的名字，非空")
    private String fenceName;

    @Schema(description = "状态，布尔值（0或1），1代表启用，0代表停用，默认为启用状态")
    private Boolean status;

    @Schema(description = "创建时间，自动设置为记录创建的时间戳")
    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "YYYY-MM-dd")
    private LocalDateTime createdAt;

    @Schema(description = "更新时间，当记录被修改时自动更新为此时间戳")
    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "YYYY-MM-dd")
    private LocalDateTime updatedAt;
}
